﻿using Domain.Entitys.FG;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace EFCore.EntityConfigurations.FG
{
    public class FG_Picking_OutboundConfiguration : IEntityTypeConfiguration<FG_Picking_Outbound>
    {
        public void Configure(EntityTypeBuilder<FG_Picking_Outbound> builder)
        {
            //设置表名和主键
            builder.ToTable("fg_picking_outbound");
            builder.HasKey(e => e.Picking_outbound_id);
            //配置与明细的关系
            builder.HasMany(e => e.Details).WithOne(e => e.Min).HasForeignKey(e => e.Picking_outbound_id);
        }
    }
}
